package br.com.exemplo.swing;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class ExemploImage {

	public static void main(String[] args) {
		JFrame janela = new JFrame("IMG");

		JPanel painel = new JPanel();
		janela.add(painel);

		File file = new File("imagens/java-logo.png");
		JLabel labelImg;
		
		try {
			BufferedImage myPicture = ImageIO.read(file);
			labelImg = new JLabel(new ImageIcon(myPicture));
		} catch (IOException e) {
			labelImg = new JLabel("Sem imagem!");
		}
		
		janela.add(labelImg);

		JLabel label = new JLabel("Texto");
		painel.add(label);

		janela.setSize(725, 500);
		janela.setVisible(true);
		janela.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	}
}
